<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg"
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <input id="type" name="type" type="hidden"
                               th:value="${type}">
                        <span th:each="timu:${listtimu}">
                        <div class="form-group">
                            <div class="col-sm-1">
                                <input id="duoxuanid" name="duoxuanid" class="form-control" type="checkbox"
                                       th:value="${timu.id}">
                            </div>
                            <div class="col-sm-10">
                                <input id="tigan" name="tigan" class="form-control" type="text" readonly
                                       th:value="${timu.titigan}">
                            </div>
                        </div>
                        </span>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button class="btn btn-primary" onclick="tianxie()">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script>
    function tianxie() {
        var type = $('#type').val();
        if (type == '1') {
            $("input[name='duoxuanid']").each(function () {
                if ($(this).attr("checked")) {
                    $(this).removeAttr("checked");
                }
            })
        } else if (type == '2') {
            $("input[type='duoxuanid']").each(function () {
                if ($(this).attr("checked")) {
                    $(this).removeAttr("checked");
                }
            })
        } else {
            $("input[type='duoxuanid']").each(function () {
                if ($(this).attr("checked")) {
                    $(this).removeAttr("checked");
                }
            })
        }
    }
</script>
</body>
</html>
